package com.pine.dbant.plugin.mysql;


import com.pine.dbant.common.plugin.meta.AbstractJdbcMetadataAnalysis;

/**
 * @author xiaoyuan
 * @create 2021/12/6 10:42
 **/
public class MysqlMetadataAnalysis  extends AbstractJdbcMetadataAnalysis{


//    @Override
//    public Table getTableDetail(String catalog, String schemaName, String tableName) {
//        String sql = " select  t1.* , t2.CHARACTER_SET_NAME  from information_schema.tables t1 left join   information_schema.COLLATION_CHARACTER_SET_APPLICABILITY  t2  on t1.table_collation = t2.collation_name where  t1.table_name='" +
//                tableName + "' and  t1.table_schema='" + catalog + "'  ";
//        Map<String,Object> map =   JdbcUtils.getSqlRunner(this.connection).selectOne(sql);
//        Table table = new Table();
//        table.setTableName(tableName);
//        table.setCatalogName(catalog);
//        table.setSchemaName(schemaName);
//        table.setTableType(String.valueOf(map.get("TABLE_TYPE")));
//        table.setTableComment(String.valueOf(map.get("TABLE_COMMENT")));
//        table.setCollation(String.valueOf(map.get("TABLE_COLLATION")));
//        table.setAutoIncrement(String.valueOf(map.get("AUTO_INCREMENT")));
//        table.setEngine(String.valueOf(map.get("ENGINE")));
//        table.setCharacter(String.valueOf(map.get("CHARACTER_SET_NAME")));
//        table.setKey(tableName);
//        table.setProperties(map);
//        table.setFields(getField(catalog, schemaName, tableName));
//        return table;
//    }
}
